package edu.pku.sei.transformation.editor.actions;

import org.eclipse.jface.action.Action;

import edu.pku.sei.transformation.editor.views.icons.IconsProvider;
import edu.pku.sei.transformation.editor.views.tree.TypedModelView;

public class ChoosePinToSelection extends Action {
	TypedModelView view;
	public ChoosePinToSelection(TypedModelView view) {
		super("pin to selection", AS_CHECK_BOX);
		setChecked(view.isPinToSelection());
		this.setImageDescriptor(IconsProvider.getImageDescriptor(IconsProvider.AREA_DIAGRAM_ICO));
		this.view = view;
	}
	
	@Override
	public void run() {
		view.setPinToSelection(isChecked());
	}
}
